import React, { Component } from 'react';
import { BrowserRouter, NavLink, Route } from 'react-router-dom';
import './index.css';
export default class index extends Component {
  render() {
    return (
      <BrowserRouter>
        <nav>
          <NavLink to="./home">首页</NavLink>
          <NavLink to="./news">新闻</NavLink>
        </nav>
        <main>
          <Route path="/home" component={() => <div>首页</div>} />
          <Route path="/news" component={() => <div>我是新闻页</div>} />
        </main>
      </BrowserRouter>
    );
  }
}
